home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # put the right font in the right place
- #
- # runlevels: geexbox, debug
-
- echo "### Setting up fonts ###"
-
- . /etc/lang.conf
- . /etc/lang.funcs
-
- readfirstword() {
- head -n 1 $1 | sed 's/^\([[:graph:]]*\).*$/\1/'
- }
-
- # set menu and help files according to language setting
- if test -f /etc/lang; then
- MENU_LANG=`readfirstword /etc/lang`
-
- cp -f /etc/mplayer/menu_$MENU_LANG.conf /etc/mplayer/menu.conf
- cp -f /usr/share/mplayer/help_$MENU_LANG.txt /usr/share/mplayer/help.txt
-
- MENU_CHARSET=`lang2charset $MENU_LANG`
- [ -z "$MENU_CHARSET" ] && exit 1
-
- MENU_FONT=`lang2font "$MENU_LANG" menu`
- if [ -f /etc/theme.conf -a -f /usr/share/fonts/themefont.ttf ]; then
- . /etc/theme.conf
- [ -z "$FONT_CHARSETS" ] && FONT_CHARSETS="iso-8859-1"
-
- for i in $FONT_CHARSETS; do
- [ "$i" = "$MENU_CHARSET" ] && MENU_FONT="themefont.ttf" && break
- done
- fi
-
- MENU_FONT="/usr/share/fonts/$MENU_FONT"
- [ ! -f "$MENU_FONT" ] && exit 1
-
- mp_set_option font "$MENU_FONT"
- fi
-
- # set subtitles font according to subfont setting
- if test -f /etc/subfont; then
- SUB_CHARSET=`readfirstword /etc/subfont`
-
- SUB_CHARSET=`lang2charset "$SUB_CHARSET"`
- [ -z "$SUB_CHARSET" ] && exit 1
-
- SUB_FONT=`lang2font "$SUB_CHARSET" sub`
- SUB_FONT="/usr/share/fonts/$SUB_FONT"
- [ ! -f "$SUB_FONT" ] && exit 1
-
- mp_set_option subfont "$SUB_FONT"
- mp_set_option subcp "$SUB_CHARSET"
- fribidi_mp_set_option "$SUB_CHARSET"
- fi
-
- # set font settings according to theme
- if test -f /etc/theme.conf; then
- . /etc/theme.conf
-
- mp_set_option subfont-text-scale "$FONT_SIZE"
- fi
-
- exit 0
-